package com.gzx.plugin.data.wckj.mapper;

import com.gzx.plugin.data.wckj.entity.JudgeTransferInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Mapper
public interface WckjJudgeTransferInfoDao {

    @Insert({
            "<script>",
            "INSERT INTO data_wckj_dcxx",
            "(ywyh_id, loan_no, period, loan_key, transfer_status, transfer_date, ",
            "transfer_principal, transfer_interest, create_time, update_time)",
            "VALUES ",
            "<foreach collection='judgeTransferInfoList' item='wckjDcxx' separator=','>",
            "(",
            "#{wckjDcxx.ywyhId}, ",
            "#{wckjDcxx.loanNo}, ",
            "#{wckjDcxx.period}, ",
            "#{wckjDcxx.loanKey}, ",
            "#{wckjDcxx.transferStatus}, ",
            "#{wckjDcxx.transferDate}, ",
            "#{wckjDcxx.transferPrincipal}, ",
            "#{wckjDcxx.transferInterest}, ",
            "NOW(), ",
            "NOW()",
            ")",
            "</foreach>",
            "</script>"
    })
    void batchSave(@Param("judgeTransferInfoList") List<JudgeTransferInfo> judgeTransferInfoList);
}
